/*
 * ChartPlugin.cpp
 *
 *  Created on: 30/07/2011
 *      Author: godinho
 */

#include "ChartPlugin.h"
#include "linechart.h"

ChartPlugin::ChartPlugin(QObject* parent) : QObject(parent){
	initialized = false;
}

void ChartPlugin::initialize(QDesignerFormEditorInterface *core) {

	if(initialized) {
		return;
	}

	initialized = true;
}

bool ChartPlugin::isInitialized() const {
	return initialized;
}

QWidget *ChartPlugin::createWidget(QWidget *parent) {
    return new LineChart(parent);
}

QString ChartPlugin::name() const {
     return "LineChart";
}

QString ChartPlugin::group() const {
    return "Charts";
}

QIcon ChartPlugin::icon() const {
    return QIcon();
}

QString ChartPlugin::toolTip() const {
    return "Display a line chart";
}

QString ChartPlugin::whatsThis() const {
     return "";
}

bool ChartPlugin::isContainer() const {
    return false;
}

QString ChartPlugin::domXml() const {
    return "<ui language=\"c++\">\n"
           " <widget class=\"LineChart\" name=\"lineChart\">\n"
           "  <property name=\"geometry\">\n"
           "   <rect>\n"
           "    <x>0</x>\n"
           "    <y>0</y>\n"
           "    <width>100</width>\n"
           "    <height>100</height>\n"
           "   </rect>\n"
           "  </property>\n"
           "  <property name=\"toolTip\" >\n"
           "   <string>Line Chart</string>\n"
           "  </property>\n"
           "  <property name=\"whatsThis\" >\n"
           "   <string>Display a line chart</string>\n"
           "  </property>\n"
           " </widget>\n"
           "</ui>\n";
}

QString ChartPlugin::includeFile() const {
     return "linechart.h";
}

Q_EXPORT_PLUGIN2(linechart, ChartPlugin)

